﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using CyclicReferences.Public;
using EditableBusinessObjects.Postsharp.Public;

namespace EditableBusinessObjects.Testing
{
    [EditableBusinessObjectAttribute]
    [CreateSerializeSurrogate("EditableBusinessObjects.Postsharp.Public.IEditableBusinessObject, EditableBusinessObjects.Postsharp.Public")]
    [Serializable]
    [DataContract(Namespace = "myNamespace", Name = "Person")]
    public class Person
    {
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public ICollection<Car> Cars { get; set; }
    }

    [EditableBusinessObjectAttribute]
    [CreateSerializeSurrogate("EditableBusinessObjects.Postsharp.Public.IEditableBusinessObject, EditableBusinessObjects.Postsharp.Public")]
    [Serializable]
    [DataContract(Namespace = "myNamespace", Name = "Car")]
    public class Car
    {
        [DataMember]
        public string Make { get; set; }

        [DataMember]
        public Person Owner { get; set; }

    }
}
